package com.eh.singleton;

/**
 * Created by David on 2016/4/29.
 */
public class ChocolateBoilerTest {
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    produceChocolate();
                }
            }).start();
        }
    }

    private static void produceChocolate() {
        ChocolateBoiler.getInstance().fill();
        ChocolateBoiler.getInstance().boil();
        ChocolateBoiler.getInstance().drain();
    }
}
